﻿<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" MasterPageFile="~/MasterPage.master"
    Inherits="Customer_List" CodeFile="Customer_List.aspx.cs" %>

<%@ Register Src="~/UserControl/GridPager.ascx" TagName="GridPager" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>客户列表</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div>
        <table id="wsd_inputtable">
            <tr>
                <td class="tabletitle" colspan="6">
                    <asp:Literal ID="Literal4" runat="server" Text="<%$resources:language,lbl_Query_Condition %>"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td class="tablefield">
                    部门
                </td>
                <td nowrap="nowrap" style="width: 20%;">
                    <asp:TextBox ID="txtOrg" runat="server" Width="150px" onkeydown="alert('请选择部门');return false;"
                        OnTextChanged="txtOrg_TextChanged" Height="20px" class="default"></asp:TextBox>
                    <img src="../Resources/Images/search.png" alt="查找" style="cursor: pointer;" onclick="openPopup('../System/PopupOrganization.aspx?NameControlId=<%# txtOrg.UniqueID %>&ValueControlId=<%# txtHidOrg.UniqueID %>&ChainsControlID=<%# txtHidChains.UniqueID %>&SelectType=multi','','300','500');" /><br />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="请选择部门!"
                        ControlToValidate="txtOrg" Display="Dynamic"></asp:RequiredFieldValidator>
                </td>
                <td class="tablefield">
                    关键字
                </td>
                <td nowrap="nowrap">
                    <asp:TextBox runat="server" ID="txtCustomer" MaxLength="30" Width="150px" class="default"></asp:TextBox>
                </td>
                <td nowrap="nowrap" class="tablefield">
                    <asp:Literal ID="Literal5" runat="server" Text="<%$resources:language,lbl_CustomerType %>"></asp:Literal>
                </td>
                <td nowrap="nowrap">
                    <asp:DropDownList runat="server" ID="drpCustomerType" Width="130">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="tablefield">
                    <asp:Literal ID="Literal9" runat="server" Text="<%$resources:language,lbl_Active %>"></asp:Literal>
                </td>
                <td>
                    <asp:DropDownList ID="ddlValid" runat="server" Width="150">
                        <asp:ListItem Value="-1" Text="--所有--"></asp:ListItem>
                        <asp:ListItem Value="1" Text="有效" Selected="True"></asp:ListItem>
                        <asp:ListItem Value="0" Text="无效"></asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td class="tablefield">
                    <asp:Literal ID="Literal2" runat="server" Text="<%$resources:language,lbl_SalesChannel %>"></asp:Literal>
                </td>
                <td nowrap="nowrap">
                    <asp:DropDownList runat="server" ID="ddlChannel" Width="150">
                    </asp:DropDownList>
                </td>
                <td class="tablefield">
                    业务代表
                </td>
                <td nowrap="nowrap">
                    <asp:DropDownList ID="ddlUserList" runat="server" Width="150">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="tablefield">
                    客户等级
                </td>
                <td class="nowrap">
                    <asp:DropDownList runat="server" ID="ddlCustomerLevel" Width="150">
                    </asp:DropDownList>
                </td>
                <td class="buttonarea" colspan="4">
                    <input id="txtHidOrg" type="hidden" runat="server" />
                    <input id="txtHidChains" type="hidden" runat="server" />
                    &nbsp; &nbsp;&nbsp;
                    <asp:Button ID="btnQuery" runat="server" class="wsd_button2" Text="查 询" OnClick="btnQuery_Click" />
                    <asp:Button ID="btnExport" runat="server" class="wsd_button2" Text="导出Excel" OnClick="btnExport_Click" />
                    <input id="Button1" type="button" class="wsd_button2" runat="server" size="47" value="重 置"
                        name="reset" onclick="clearForm('form1')" />
                   <input type="button" class="wsd_button2" value="地图模式"
                         onclick="location.href='CUSTOMERMAPLIST.ASPX';" />
                </td>
            </tr>
        </table>
        <br />
        <table id="wsd_inputtable">
            <tr>
                <td class="tabletitle">
                    <asp:Literal ID="Literal11" runat="server" Text="<%$resources:language,lbl_CustomerList %>"></asp:Literal>
                </td>
            </tr>
        </table>
        <table id="wsd_listtable">
            <tr>
                <td style="width: 100%">
                    <asp:GridView BorderWidth="0" GridLines="None" Width="100%" ID="gvChannelType" runat="server"
                        AutoGenerateColumns="false" EmptyDataText="<%$resources:language,lbl_Empty %>"
                        EmptyDataRowStyle-Font-Bold="true" EmptyDataRowStyle-HorizontalAlign="Center"
                        EnableEmptyContentRender="true" AllowPaging="True" PageSize="25" OnRowDataBound="gvChannelType_RowDataBound"
                        OnPageIndexChanging="PageIndexChanged">
                        <HeaderStyle CssClass="titlist" />
                        <EmptyDataRowStyle HorizontalAlign="Center" Font-Bold="True"></EmptyDataRowStyle>
                        <Columns>
                            <asp:TemplateField HeaderText="编号" ShowHeader="False">
                                <ItemTemplate>
                                    <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="" Text='<%# Eval("Code")%>'></asp:HyperLink>
                                </ItemTemplate>
                                <ControlStyle Font-Underline="False" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="<%$resources:language,lbl_CustomerName %>">
                                <ItemTemplate>
                                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="" Text='<%# Eval("NAME")%>'></asp:HyperLink>
                                </ItemTemplate>
                                <ControlStyle Font-Underline="False" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="销售渠道 ">
                                <ItemTemplate>
                                    <%# Eval("Channel").ToString().Length > 6 ? Eval("Channel").ToString().Substring(0, 6) + "..." : Eval("Channel").ToString() %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="市场" Visible="False" DataField="CountyName" />
                            <asp:BoundField HeaderText="乡镇/街道" Visible="False" DataField="RegionName" />
                            <asp:TemplateField HeaderText="地址 ">
                                <ItemTemplate>
                                    <%# Eval("ADDRESS_LINE").ToString().Length > 6 ? Eval("ADDRESS_LINE").ToString().Substring(0, 6) + "..." : Eval("ADDRESS_LINE").ToString()%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="联系方式" DataField="TELEPHONE" />
                            <asp:BoundField HeaderText="手机" DataField="FAX" Visible="false" />
                            <asp:BoundField HeaderText="联系人" DataField="SLOG_CODE" />
                            <asp:BoundField HeaderText="创建人" Visible="False" DataField="CreateUser" />
                            <asp:BoundField HeaderText="创建时间" DataField="Create_Time" />
                            <asp:TemplateField HeaderText="<%$resources:language,lbl_Active %>" ItemStyle-HorizontalAlign="center"
                                HeaderStyle-HorizontalAlign="center">
                                <ItemTemplate>
                                    <b>
                                        <%# Eval("ACTIVE").ToString().ToUpper()  == "TRUE" ? "<font size='3' color='green'>√</font>" : "<font size='3' color='red'>×</font>"%></b>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            </asp:TemplateField>
                        </Columns>
                        <RowStyle CssClass="evenline" />
                        <AlternatingRowStyle CssClass="oddline" />
                        <PagerSettings Visible="false" />
                    </asp:GridView>
                    <uc1:GridPager ID="GridPager1" runat="server" Visible="false" />
                </td>
            </tr>
        </table>
        <br />
        <table id="wsd_inputtable">
            <tr>
                <td width="100%" class="tabletitle">
                    <asp:Literal ID="Literal12" runat="server" Text="<%$resources:language,lbl_Operation_Area %>"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td class="buttonarea">
                    <asp:Button ID="btnNew" runat="server" class="wsd_button2" Text="<%$resources:language,btn_Add %>"
                        OnClientClick="location.href='Customer_Maintain.aspx';return false;" CausesValidation="False" />
                    &nbsp;
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
